import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class FriendsMap extends Mapper <LongWritable,Text,Text,Text> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String line = value.toString();
        String[] clip = line.split(" ");
        /***
         * A B
         * C B
         * B D
         * E D
         * ***/
        context.write(new Text(clip[0]),new Text(clip[1]));
        context.write(new Text(clip[1]),new Text(clip[0]));
    }
}
